package edu.zut.operator;

import java.util.Scanner;

public class OperatorDemo5 {

    public static void main(String[] args) {
        int j = 10;   //1010
        int k = 12;   //1100
        System.out.println(j & k);  //与   1000
        System.out.println(j | k);  //或   1110
        System.out.println(j ^ k);  //异或  0110

        //三目运算符   boolean表达式 ?  表达式1 : 表达式2
        //boolean表达式为true  表达式1
        //boolean表达式为true  表达式2
        Scanner scanner = new Scanner(System.in);
        System.out.println("请用户输入账号以及密码");
        String username = scanner.next();
        String password = scanner.next();
        boolean flag1 = username.equals("jack");
        boolean flag2 = password.equals("123456");
        boolean result = flag1 && flag2;
        String msg = result ? "账号密码正确，成功" : "账号或密码错误";
        System.out.println(msg);


        int i = 5;
        i = ++i * 5;
        System.out.println(i);
    }


    /**
     * 优先级
     *  ()   -(负号)
     *  ++   --
     *    *   /   %
     *    +  -
     *  >  <  >=  <=   ==   !=
     *  &&  ||
     *   ? :
     *  =
     */
}